package com.letao.service.impl;

import com.letao.mapper.TbItemCatMapper;
import com.letao.pojo.TbItemCat;
import com.letao.pojo.TbItemCatExample;
import com.letao.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ac on 2017/1/10.
 */
@Service
public class ItemCatServiceImpl implements ItemCatService {

    @Autowired
    private TbItemCatMapper tbItemCatMapper;

    @Override
    public List<TbItemCat> getItemCatListByParent(Long parentID) {
        TbItemCatExample example = new TbItemCatExample();
        TbItemCatExample.Criteria criteria = example.createCriteria();
        criteria.andParentIdEqualTo(parentID);
        List<TbItemCat> itemCatList = tbItemCatMapper.selectByExample(example);
        return itemCatList;
    }
}
